<layout name="layout" />
<!-- 搜索 -->
<div class="form-div search_form_div">
    <form action="__ACTION__" method="GET" name="search_form" class="layui-form layui-form-pane">
      <div class="layui-form-item">
         <label class="layui-form-label">序列号</label>
         <div class="layui-input-inline">
           <input type="text" name="sernumber"  value="<?php echo I('get.sernumber'); ?>" class="layui-input"/>
         </div>
         <input type="submit" class="layui-btn" value="搜索"/>
       </div>
    <a href="<?php echo U('datatable/add'); ?> " class="layui-btn layui-btn-small">添加数据项</a>
    </form>
</div>
<!-- 列表 -->
<div class="list-div" id="listDiv">
	<table class="layui-table" lay-skin="line">
    	<tr>
            <th >数据项名称</th>
            <th >数据项别名</th>
            <th >数据地址</th>
            <th >类型</th>
            <th >值</th>
            <th >时间</th>
			      <th >操作</th>
        </tr>
		<?php foreach ($data as $k => $v): ?>
			<tr class="tron">
				<td><?php echo $v['name']; ?></td>
				<td><?php echo $v['nickname']; ?></td>
				<td><?php echo $v['jicunqi'].$v['address']; ?></td>

				<td>
					<?php
					if($v['type']=='BIT') echo '开关量';
					if($v['type']=='WORD') echo '数值';
					 ?>
				</td>
				<td><?php echo $v['value']; ?></td>
				<td><?php echo $v['update_time']; ?></td>
		        <td >
		        	<a href="<?php echo U('edit?id='.$v['id'].'&p='.I('get.p')); ?>" title="编辑" class="layui-btn layui-btn-small">编辑</a>
	                <a href="<?php echo U('delete?id='.$v['id'].'&p='.I('get.p')); ?>"class="layui-btn layui-btn-small" onclick="return confirm('确定要删除吗？');" title="移除">移除</a>
		        </td>
	        </tr>
        <?php endforeach; ?>
		<?php if(preg_match('/\d/', $page)): ?>
        <tr><td align="right" nowrap="true" colspan="99" height="30"><?php echo $page; ?></td></tr>
        <?php endif; ?>
	</table>
</div>
<script>
</script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Admin/Js/tron.js"></script>
